﻿@{
    ViewBag.Title = "出院登记表";
    Layout = "~/Views/Shared/_Index.cshtml";
    var reportUrl = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportUrl");
    var reportSystemCode = Newtouch.Core.Common.Utils.ConfigurationHelper.GetAppConfigValue("ReportSystemCode");
}

<div class="rows">
	<div class="panel panel-default">
		<table class="form">
			<tr>
				<th class="formTitle">住院号：</th>
				<td class="formValue">
					<input id="zyh" name="zyh" type="text" autocomplete="off" class="form-control" />
				</td>
				<th class="formTitle">出院日期：</th>
				<td class="formValue" style="padding-left:20px;">
					<input id="ksrq" type="text" class="form-control input-wdatepicker formClearIgnore" style="width:90px"
						   onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })"
						   onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', onpicked: function () { refReport(); } })"
						   value="@DateTime.Now.ToString("yyyy-MM-01")" />
				</td>
				<td class="formValue">
				<th class="formTitle">~</th>
				<td class="formValue">
					<input id="jsrq" type="text" class="form-control input-wdatepicker formClearIgnore" style="width:90px"
						   onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })"
						   onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', onpicked: function () { refReport(); } })"
						   value="@DateTime.Now.ToString("yyyy-MM-dd")" />
				</td>
				<th class="formTitle" style="padding-left:20px;">签收状态：</th>
				<td class="formValue">
					<select id="blzt" class="form-control" style="width:90px">
						<option value="4">==全部==</option>
						<option value="3">已签收</option>
						<option value="1">未签收</option>
					</select>
				</td>
				<th class="formTitle"></th>
				<td class="formValue" style="padding-left:20px;">
					<input type="button" id="btn_search" onclick="submit();" class="btn btn-primary btn-md" value="查询" style="width:55px" />
				</td>
				<th></th>
				<td></td>
				<th></th>
				<td></td>
			</tr>
		</table>
	</div>
</div>
<div class="ui-layout" id="layout" style="height:100%;width:100%;">
	<iframe class="ui-layout-center" style="width:100%;" id="iframerightiframerightiframerightttt" name="iframerightiframerightiframerightttt"
			scrolling="auto" allowtransparency="true" frameborder="0"></iframe>
</div>
<script type="text/javascript">
    var reportServerHOST = '@(ViewBag.ReportServerHOST)';
    var orgId = '@(ViewBag.OrgId)';
	$(function () {
		submit();
    });

    function submit() {
        if ($('#ksrq').val().length == 0 || $('#jsrq').val().length == 0) {
            $.modalAlert("请选择时间范围", "error");
            return;
        }

		//var reportServerHOST = '@(ViewBag.ReportServerHOST)';
		$.ajax({
			url: "/RecordManage/MrHospitalReport/getOrgId",
			dataType: "json",
			async: false,
			success: function (data) {
			    var orgId = data.orgId;
			    var url = '@reportUrl' + "?tempCode=" + "1285" + "&orgId=" + orgId + "&systemCode=" + '@reportSystemCode';
				url += "&zyh=" + $('#zyh').val() + "&kssj=" + $('#ksrq').val() + "&jssj=" + $('#jsrq').val() + "&blzt=" + $('#blzt').val();
				setTimeout("$.loading(true, '正在请求报表页面...');", 10);
				$("#iframerightiframerightiframerightttt").attr('src', url);
			}
		});
		
    }

    $("#iframerightiframerightiframerightttt").load(function () {
        $.loading(false);
    });

    $(function () {
        var h = $(window).height() - 55
        $('#layout iframe').css('height', h);

    });

    //刷新列表
    function refReport() {
        $("#btn_search").trigger('click');
    }
	
    @*init();

	function init() {
		var reportServerHOST = '@(ViewBag.ReportServerHOST)';
		$.ajax({
			url: "/RecordManage/MrHospitalReport/getOrgId",
			dataType: "json",
			async: false,
			success: function (data) {
				var orgId = data.orgId;
				var url = reportServerHOST +'Pages/ReportViewer.aspx?%2fNewtouch.Report.MRMS%2f%e5%87%ba%e9%99%a2%e7%99%bb%e8%ae%b0%e8%a1%a8&rs:Command=Render&orgId=' + orgId;
				window.location.href = url;
			}
		});
	}*@

</script>

